﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;

namespace TL_Cloud.ViewModels.BookShop.BaseClass
{
    public class BaseClassAddOrUpdateResourceValidator<T> : AbstractValidator<T>
          where T : BaseClassBasicResource
    {
        public BaseClassAddOrUpdateResourceValidator()
        {
            RuleFor(x => x.ClassName)
                 .NotNull()
                 .WithName("班级")
                 .WithMessage("required|{PropertyName}是必填的")
                 .MaximumLength(20)
                 .WithMessage("maxlength|{PropertyName}的最大长度是{MaxLength}");
        }
    }
}
